package org.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.feign.ProductFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class UserController {

    @Value("${server.port}")
    private int port;

    @Autowired
    private ProductFeign productFeign;

    @GetMapping("/user")
    public String user() {
        log.info("user ok! port={}", port);
        String product = productFeign.product();
        return "user ok! port=" + port + "----- \n" + product;
    }

}
